import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/LoginView.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/RegisterView.vue')
  },
  {
    path: '/home/dashboard',
    name: 'Dashboard',
    component: () => import('@/views/Dashboard.vue'),
    children: [
      {
        path: '/home',
        name: 'Home',
        component: Home,
        meta: { title: '首页', icon: ['fas', 'house-user'], top: true }
      },
      {
        path: '/info',
        name: 'Info',
        component: () => import('@/views/Info.vue')
      },

      // 文章分类
      {
        path: '/Articlecategories',
        name: 'Articlecategories',
        meta: { 
          title: '文章分类', 
          icon: ['fas', 'gear'],
          top: true
        },
        children: [
          {
            path: 'Createcategory',
            name: 'Createcategory',
            component: () => import('@/views/Articlecategories/Createcategory.vue'),
            meta: { 
              title: '新建分类', 
              icon: ['fas', 'sliders'] 
            }
          },
          {
            path: 'Categorylist',
            name: 'Categorylist',
            component: () => import('@/views/Articlecategories/Categorylist.vue'),
            meta: { 
              title: '分类列表', 
              icon: ['fas', 'wrench'] 
            }
          },
          // {
          //   path: 'payment-settings',
          //   name: 'PaymentSettings',
          //   component: () => import('@/views/Articlecategories/PaymentSettings.vue'),
          //   meta: { 
          //     title: '支付设置', 
          //     icon: ['fas', 'credit-card'] 
          //   }
          // },
          // {
          //   path: 'notification-settings',
          //   name: 'NotificationSettings',
          //   component: () => import('@/views/Articlecategories/NotificationSettings.vue'),
          //   meta: { 
          //     title: '通知设置', 
          //     icon: ['fas', 'bell'] 
          //   }
          // }
        ]
      },

      // 文章管理
      {
        path: '/Articlemanagement',
        name: 'Articlemanagement',
        meta: { 
          title: '文章管理', 
          icon: ['fas', 'users'],
          top: true
        },
        children: [
          {
            path: 'Createarticle',
            name: 'Createarticle',
            component: () => import('@/views/Articlemanagement/Createarticle.vue'),
            meta: { 
              title: '新建文章', 
              icon: ['fas', 'list'] 
            }
          },
          {
            path: 'Articlestatus',
            name: 'Articlestatus',
            component: () => import('@/views/Articlemanagement/Articlestatus.vue'),
            meta: { 
              title: '文章状态', 
              icon: ['fas', 'users-between-lines'] 
            }
          },
          {
            path: 'Articlelist',
            name: 'Articlelist',
            component: () => import('@/views/Articlemanagement/Articlelist.vue'),
            meta: { 
              title: '文章列表', 
              icon: ['fas', 'right-to-bracket'] 
            }
          },
          {
            path: 'operation-logs',
            name: 'OperationLogs',
            component: () => import('@/views/Articlemanagement/OperationLogs.vue'),
            meta: { 
              title: '操作日志', 
              icon: ['fas', 'clipboard-list'] 
            }
          }
        ]
      },

      // 个人中心
      {
        path: '/Personalcenter',
        name: 'Personalcenter',
        meta: { 
          title: '个人中心', 
          icon: ['fas', 'user-shield'],
          top: true
        },
        children: [
          {
            path: 'Basicinformation',
            name: 'Basicinformation',
            component: () => import('@/views/Personalcenter/Basicinformation.vue'),
            meta: { 
              title: '基本资料', 
              icon: ['fas', 'id-card'] 
            }
          },
          {
            path: 'ChangeProfilepicture',
            name: 'ChangeProfilepicture',
            component: () => import('@/views/Personalcenter/ChangeProfilepicture.vue'),
            meta: { 
              title: '更换头像', 
              icon: ['fas', 'key'] 
            }
          },
          {
            path: 'Resetpassword',
            name: 'Resetpassword',
            component: () => import('@/views/Personalcenter/Resetpassword.vue'),
            meta: { 
              title: '重置密码', 
              icon: ['fas', 'bars'] 
            }
          },
          // {
          //   path: 'api-permission',
          //   name: 'ApiPermission',
          //   component: () => import('@/views/Personalcenter/ApiPermission.vue'),
          //   meta: { 
          //     title: '接口权限', 
          //     icon: ['fas', 'plug'] 
          //   }
          // }
        ]
      },
      
      // 部门管理
      // {
      //   path: '/department-management',
      //   name: 'DepartmentManagement',
      //   meta: { 
      //     title: '部门管理', 
      //     icon: ['fas', 'sitemap'],
      //     top: true
      //   },
      //   children: [
      //     {
      //       path: 'department-structure',
      //       name: 'DepartmentStructure',
      //       component: () => import('@/views/department-management/DepartmentStructure.vue'),
      //       meta: { 
      //         title: '部门结构', 
      //         icon: ['fas', 'diagram-project'] 
      //       }
      //     },
      //     {
      //       path: 'position-management',
      //       name: 'PositionManagement',
      //       component: () => import('@/views/department-management/PositionManagement.vue'),
      //       meta: { 
      //         title: '岗位管理', 
      //         icon: ['fas', 'briefcase'] 
      //       }
      //     },
      //     {
      //       path: 'personnel-assignment',
      //       name: 'PersonnelAssignment',
      //       component: () => import('@/views/department-management/PersonnelAssignment.vue'),
      //       meta: { 
      //         title: '人员分配', 
      //         icon: ['fas', 'user-plus'] 
      //       }
      //     }
      //   ]
      // },
      
      // 系统工具
      // {
      //   path: '/system-tools',
      //   name: 'SystemTools',
      //   meta: { 
      //     title: '系统工具', 
      //     icon: ['fas', 'screwdriver-wrench'],
      //     top: true
      //   },
      //   children: [
      //     {
      //       path: 'data-backup',
      //       name: 'DataBackup',
      //       component: () => import('@/views/system-tools/DataBackup.vue'),
      //       meta: { 
      //         title: '数据备份', 
      //         icon: ['fas', 'database'] 
      //       }
      //     },
      //     {
      //       path: 'cache-management',
      //       name: 'CacheManagement',
      //       component: () => import('@/views/system-tools/CacheManagement.vue'),
      //       meta: { 
      //         title: '缓存管理', 
      //         icon: ['fas', 'memory'] 
      //       }
      //     },
      //     {
      //       path: 'system-update',
      //       name: 'SystemUpdate',
      //       component: () => import('@/views/system-tools/SystemUpdate.vue'),
      //       meta: { 
      //         title: '系统更新', 
      //         icon: ['fas', 'arrow-up-from-bracket'] 
      //       }
      //     },
      //     {
      //       path: 'task-scheduling',
      //       name: 'TaskScheduling',
      //       component: () => import('@/views/system-tools/TaskScheduling.vue'),
      //       meta: { 
      //         title: '任务调度', 
      //         icon: ['fas', 'clock'] 
      //       }
      //     }
      //   ]
      // },
      
      // 开发工具
      // {
      //   path: '/development-tools',
      //   name: 'DevelopmentTools',
      //   meta: { 
      //     title: '开发工具', 
      //     icon: ['fas', 'code'],
      //     top: true
      //   },
      //   children: [
      //     {
      //       path: 'api-management',
      //       name: 'ApiManagement',
      //       component: () => import('@/views/development-tools/ApiManagement.vue'),
      //       meta: { 
      //         title: 'API管理', 
      //         icon: ['fas', 'api'] 
      //       }
      //     },
      //     {
      //       path: 'code-generation',
      //       name: 'CodeGeneration',
      //       component: () => import('@/views/development-tools/CodeGeneration.vue'),
      //       meta: { 
      //         title: '代码生成', 
      //         icon: ['fas', 'file-code'] 
      //       }
      //     },
      //     {
      //       path: 'api-testing',
      //       name: 'ApiTesting',
      //       component: () => import('@/views/development-tools/ApiTesting.vue'),
      //       meta: { 
      //         title: '接口测试', 
      //         icon: ['fas', 'vial'] 
      //       }
      //     },
      //     {
      //       path: 'log-viewer',
      //       name: 'LogViewer',
      //       component: () => import('@/views/development-tools/LogViewer.vue'),
      //       meta: { 
      //         title: '日志查看', 
      //         icon: ['fas', 'file-lines'] 
      //       }
      //     }
      //   ]
      // },
      
      // 第三方服务
      // {
      //   path: '/third-party-services',
      //   name: 'ThirdPartyServices',
      //   meta: { 
      //     title: '第三方服务', 
      //     icon: ['fas', 'plug'],
      //     top: true
      //   },
      //   children: [
      //     {
      //       path: 'payment-integration',
      //       name: 'PaymentIntegration',
      //       component: () => import('@/views/third-party-services/PaymentIntegration.vue'),
      //       meta: { 
      //         title: '支付集成', 
      //         icon: ['fas', 'money-bill-transfer'] 
      //       }
      //     },
      //     {
      //       path: 'sms-service',
      //       name: 'SmsService',
      //       component: () => import('@/views/third-party-services/SmsService.vue'),
      //       meta: { 
      //         title: '短信服务', 
      //         icon: ['fas', 'comment-sms'] 
      //       }
      //     },
      //     {
      //       path: 'map-service',
      //       name: 'MapService',
      //       component: () => import('@/views/third-party-services/MapService.vue'),
      //       meta: { 
      //         title: '地图服务', 
      //         icon: ['fas', 'map-location-dot'] 
      //       }
      //     },
      //     {
      //       path: 'social-login',
      //       name: 'SocialLogin',
      //       component: () => import('@/views/third-party-services/SocialLogin.vue'),
      //       meta: { 
      //         title: '社交登录', 
      //         icon: ['fas', 'share-nodes'] 
      //       }
      //     }
      //   ]
      // },
      
      // 文档中心
      // {
      //   path: '/documentation',
      //   name: 'Documentation',
      //   meta: { 
      //     title: '文档中心', 
      //     icon: ['fas', 'book'],
      //     top: true
      //   },
      //   children: [
      //     {
      //       path: 'user-manual',
      //       name: 'UserManual',
      //       component: () => import('@/views/documentation/UserManual.vue'),
      //       meta: { 
      //         title: '使用手册', 
      //         icon: ['fas', 'book-open'] 
      //       }
      //     },
      //     {
      //       path: 'api-documentation',
      //       name: 'ApiDocumentation',
      //       component: () => import('@/views/documentation/ApiDocumentation.vue'),
      //       meta: { 
      //         title: 'API文档', 
      //         icon: ['fas', 'file-code'] 
      //       }
      //     },
      //     {
      //       path: 'development-guide',
      //       name: 'DevelopmentGuide',
      //       component: () => import('@/views/documentation/DevelopmentGuide.vue'),
      //       meta: { 
      //         title: '开发指南', 
      //         icon: ['fas', 'code'] 
      //       }
      //     },
      //     {
      //       path: 'faq',
      //       name: 'FAQ',
      //       component: () => import('@/views/documentation/FAQ.vue'),
      //       meta: { 
      //         title: 'FAQ', 
      //         icon: ['fas', 'circle-question'] 
      //       }
      //     }
      //   ]
      // },
      
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router